package net.blogjava.mobile.main;

import net.blogjava.mobile.Main;
import net.blogjava.mobile.widget.FileBrowser;
import android.app.Instrumentation;
import android.test.ActivityInstrumentationTestCase2;
import android.test.UiThreadTest;

public class MainTest extends ActivityInstrumentationTestCase2<Main> {
	
    private Main mActivity;
    private FileBrowser mFileBrowser;
	private  mFileAdapter;

	public MainTest() {
		super("net.blogjava.mobile.Main", Main.class);
    }
	
	 @Override
	    protected void setUp() throws Exception 
	    {
	        super.setUp();
	        setActivityInitialTouchMode(false);
	        mActivity = getActivity();

	        mFileBrowser = (FileBrowser) mActivity.findViewById(net.blogjava.mobile.R.id.FileBrowser);
	        mFileAdapter = mFileBrowser.getAdapter();
	    }
	 
	 public void testPreConditions() 
	 {
		 assertTrue(mFileBrowser.setOnFileBrowserListener() != null);


	 } 

		public void testMainUI() 
		{
			mActivity.runOnUiThread
			( 
					new Runnable() 
					{
						public void run() 
						{


						} // end of run() method definition
					} // end of anonymous Runnable object instantiation
			); // end of invocation of runOnUiThread
		}

		public void testStateDestroy() 
		{
			mActivity.finish();
			mActivity = this.getActivity();
		}

		@UiThreadTest
		public void testStatePause() 
		{
			Instrumentation mInstr = this.getInstrumentation();
			mInstr.callActivityOnPause(mActivity);		
			mInstr.callActivityOnResume(mActivity);
		}

}
